const URL=require('./url');

// 生成 proxy 拦截配置
const proxy={};
for (const key in URL) {
    let path="/"+key;
    let text="^/"+key;
    proxy[path]={
        target:URL[key], //请求地址
        pathRewrite:{},
        ws: true, 
        changeOrigin:true,//允许跨域
        secure:true, //https
        logLevel:'debug' //终端打印路径 
    }
    proxy[path]['pathRewrite'][text]='/';//替换
}

module.exports={...proxy}
